<template>
    <div class="e-table">
        <el-table
            :data="historyData"
            ref='historyTable'
            border
            style="width: 100%"
            v-sortTable="{ 'tableData': historyData, '_this': this, 'ref': 'historyTable' }"
        >
            <el-table-column
                show-overflow-tooltip
                prop="unitName"
                label="审核级次"
            >
            </el-table-column>
            <el-table-column
                show-overflow-tooltip
                prop="assignUser"
                label="审核人"
                width="120"
            >
            </el-table-column>
            <el-table-column
                show-overflow-tooltip
                prop="notifyTime"
                label="通知时间"
                width="180"
            >
            </el-table-column>
            <el-table-column
                show-overflow-tooltip
                prop="completeTime"
                label="审核时间"
                width="180"
            >
            </el-table-column>
            <el-table-column
                show-overflow-tooltip
                prop="opinion"
                label="审核意见"
                width="250"
            >
            </el-table-column>
        </el-table>
        <ComPagination
            v-if="pagination.total"
            :total="pagination.total"
            :pageSize.sync="pagination.pageSize"
            :currentPage.sync="pagination.currentPage"
            :tableData.sync="historyData"
        />
    </div>
</template>

<script>
// import auditRequest from '@/api/tender/audit.js'
import ComPagination from '@/components/pagination/pagination.vue'

export default {
    props: {
        billType: {
            type: Number,
            default: 0
        },
        billId: {
            type: String,
            require: false
        }
        // tableData: {
        //     type: Array,
        //     default: ()=>{
        //         return []
        //     }
        // }
    },
    data () {
        return {
            auditParams: {
                billId: this.billId,
                billType: this.billType,
                freeNextUnitIndex: 0,
                freeNextUser: '',
                isPass: true,
                isShareInAudit: true,
                opinion: '',
                orgId: '',
                orgName: '',
                userId: '',
                workId: ''
            },
            pagination: {
                total: 0,
                pageSize: 10,
                currentPage: 1
            },
            tableData: [],
            historyData: []
        }
    },
    components: {
        ComPagination
    },
    created () {
        this.getAuditHistory()
    },
    methods: {
        async getAuditHistory () {
            this.historyData = await this.$Ajax.httpPost({
                url: '/facilitysettle/flowEngin/get/audit/history',
                params: this.auditParams
            })
            this.$emit('historyTableHeight', this.historyData)
        }
    }
}
</script>

<style lang="sass" scoped></style>
